package com.ruoyi.mall.app.service.impl;

import com.ruoyi.mall.app.service.DtsGoodsProductService;
import com.ruoyi.mall.common.domain.DtsGoodsProduct;
import com.ruoyi.mall.common.domain.DtsSeckillBatch;
import com.ruoyi.mall.common.mapper.DtsGoodsProductMapper;
import com.ruoyi.mall.common.mapper.DtsSeckillBatchMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DtsGoodsProductServiceImpl implements DtsGoodsProductService {

    @Autowired
    private DtsGoodsProductMapper dtsGoodsProductMapper;

    @Autowired
    private DtsSeckillBatchMapper dtsSeckillBatchMapper;

    @Override
    public List<DtsGoodsProduct> selectGoodsProductCountByGoodsId(int goodsId) {
        return dtsGoodsProductMapper.selectGoodsProductCountByGoodsId(goodsId);
    }

    @Override
    public int selectGoodsProductStock(int goodsId) {
        return dtsGoodsProductMapper.selectGoodsProductStock(goodsId);
    }

    @Override
    public List<DtsGoodsProduct> selectSeckillAndProduct(DtsSeckillBatch dtsSeckillBatch) {
        return dtsSeckillBatchMapper.selectSeckillAndProduct(dtsSeckillBatch);
    }
}
